<form id="edit-form" class="form-horizontal" role="form" data-toggle="validator" method="POST" action="">

    <div class="form-group">
        <label class="control-label col-xs-12 col-sm-2">{:__('Code')}:</label>
        <div class="col-xs-12 col-sm-8">
            <input id="c-code" data-rule="required" class="form-control" name="row[code]" type="text" value="{$row.code|htmlentities}">
        </div>
    </div>
    <div class="form-group">
        <label class="control-label col-xs-12 col-sm-2">{:__('Title')}:</label>
        <div class="col-xs-12 col-sm-8">
            <input id="c-title" class="form-control" name="row[title]" type="text" value="{$row.title|htmlentities}">
        </div>
    </div>
    <div class="form-group">
        <label class="control-label col-xs-12 col-sm-2">{:__('Desc')}:</label>
        <div class="col-xs-12 col-sm-8">
            <input id="c-desc" class="form-control" name="row[desc]" type="text" value="{$row.desc|htmlentities}">
        </div>
    </div>
    <div class="form-group">
        <label class="control-label col-xs-12 col-sm-2">{:__('Type')}:</label>
        <div class="col-xs-12 col-sm-8">
                        
            <select  id="c-type" min="0" class="form-control selectpicker" name="row[type]">
                {foreach name="typeList" item="vo"}
                    <option value="{$key}" {in name="key" value="$row.type"}selected{/in}>{$vo}</option>
                {/foreach}
            </select>

        </div>
    </div>

    <div class="form-group" data-favisible="type=1">
        <label class="control-label col-xs-12 col-sm-2">{:__('Model_content')}:</label>
        <div class="col-xs-12 col-sm-8">
            <textarea id="c-model_content" class="form-control editor" rows="5" name="row[model_content]" cols="50">{$row.model_content|htmlentities}</textarea>
        </div>
    </div>

    <div class="form-group" data-favisible="type=2">
        <label class="control-label col-xs-12 col-sm-2">{:__('Sql_content')}:</label>
        <div class="col-xs-12 col-sm-8">
            <textarea id="c-sql_content" class="form-control" rows="5" name="row[sql_content]" cols="50">{$row.sql_content|htmlentities}</textarea>
        </div>
    </div>

    <div class="form-group" data-favisible="type=3">
        <label class="control-label col-xs-12 col-sm-2">{:__('Hook_name')}:</label>
        <div class="col-xs-12 col-sm-8">
            <input id="c-hook_name" class="form-control" name="row[hook_name]" type="text" value="{$row.hook_name|htmlentities}">
        </div>
    </div>


    <div class="form-group">
        <label class="control-label col-xs-12 col-sm-2">{:__('Params')}:</label>
        <div class="col-xs-12 col-sm-8">
            <table class="table table-responsive fieldlist" data-name="row[params]" data-template="paramstpl" data-tag="tr">
                <tr>
                    <td>参数</td>
                    <td>默认值</td>
                    <td>备注</td>
                    <td></td>
                </tr>
                <tr>
                    <td colspan="5"><a href="javascript:;" class="btn btn-sm btn-success btn-append"><i class="fa fa-plus"></i> 追加</a></td>
                </tr>
                <textarea name="row[params]" class="form-control hide" cols="30" rows="5">{$row.params}</textarea>
            </table>
            <!--定义模板，模板语法使用Art-Template模板语法-->
            <script type="text/html" id="paramstpl">
                <tr class="form-inline">
                    <td><input type="text" name="row[<%=name%>][<%=index%>][key]" class="form-control" value="<%=row['key']%>" size="10"></td>
                    <td><input type="text" name="row[<%=name%>][<%=index%>][value]" class="form-control" value="<%=row['value']%>" size="10"></td>
                    <td><input type="text" name="row[<%=name%>][<%=index%>][name]" class="form-control" value="<%=row['name']%>" size="20"></td>
                    <td><span class="btn btn-sm btn-danger btn-remove"><i class="fa fa-times"></i></span> <span class="btn btn-sm btn-primary btn-dragsort"><i class="fa fa-arrows"></i></span></td>
                </tr>
            </script>

        </div>
    </div>



    <div class="form-group">
        <label class="control-label col-xs-12 col-sm-2">{:__('Tags')}:</label>
        <div class="col-xs-12 col-sm-8">
            <input id="c-tags" class="form-control" data-role="tagsinput" name="row[tags]" type="text" value="{$row.tags|htmlentities}">
        </div>
    </div>
    <div class="form-group">
        <label class="control-label col-xs-12 col-sm-2">{:__('Result')}:</label>
        <div class="col-xs-12 col-sm-8">
            <textarea id="c-result" class="form-control " readonly rows="5" name="row[result]" cols="50">{$row.result|htmlentities}</textarea>
        </div>
    </div>

    <input type="hidden" name="_method" id="method" value="">

    <div class="form-group layer-footer">
        <label class="control-label col-xs-12 col-sm-2"></label>
        <div class="col-xs-12 col-sm-8">
            <button type="submit" class="btn btn-primary btn-embossed disabled">{:__('OK')}</button>
            <button type="button" class="btn btn-warning  btn-test">运行</button>
        </div>
    </div>
</form>
